package diagram

import (
	
	
)

// removeComments removes Mermaid comment lines from input.
// This function is shared between graph and sequence diagram parsers.
// It handles both full-line comments (%% at start) and inline comments (%% after content).
func ( []string) []string {
	 := make([]string, 0, len())

	for ,  := range  {
		// Skip lines that start with %% (full-line comments)
		if strings.HasPrefix(strings.TrimSpace(), "%%") {
			continue
		}

		// Remove inline comments (anything after %%)
		if  := strings.Index(, "%%");  != -1 {
			 = strings.TrimSpace([:])
		}

		// Only keep non-empty lines after comment removal
		if len(strings.TrimSpace()) > 0 {
			 = append(, )
		}
	}

	return 
}

// SplitLines splits input on both actual newlines and escaped newlines (for curl compatibility).
func ( string) []string {
	 := regexp.MustCompile(`\n|\\n`)
	return .Split(, -1)
}